function count (array, number) {
    const countArr = array.reduce((accumulator, currentValue) => {
      accumulator[currentValue] ?
        accumulator[currentValue]++ : accumulator[currentValue] = 1
      return accumulator
    }, {});
    return countArr[number] || 0;
  }
  console.log(count([1, 1, 2, 3, 3, 4, 6, 6], 3));